package xdrawer.test;

import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.control.Button;
import javafx.scene.image.Image;
import javafx.scene.layout.HBox;

public class MyToolBox extends HBox {
    Button b1;
    Button b2;
    Button b3;
    Button b4;

    private PicturePane operateTarget;
    private ShowPane parent;


    public MyToolBox(){
        b1= new Button("1");
        b2= new Button("2");
        b3= new Button("3");
        b4= new Button("4");

        this.getChildren().addAll(b1,b2,b3,b4);

        b1.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent event) {
                int i = parent.getCurrentIndex();
                parent.setCurrentIndex(i++);
                operateTarget.setImage(new Image(("")));
            }
        });
    }

    public void setOperateTarget(PicturePane pane){
        this.operateTarget = pane;
    }

    public void setParent(ShowPane pane){
        this.parent = pane;
    }
}
